<!--[if lte IE 9]>
<script src="<?cs var:config.dwzpath?>js/speedup.js" type="text/javascript"></script>
<![endif]-->

<script src="<?cs var:config.dwzpath?>js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/jquery.cookie.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/jquery.validate.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/jquery.bgiframe.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>xheditor/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>uploadify/scripts/jquery.uploadify.js" type="text/javascript"></script>

<script src="<?cs var:config.dwzpath?>js/dwz.core.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.util.date.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.validate.method.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.regional.zh.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.barDrag.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.drag.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.tree.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.accordion.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.ui.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.theme.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.switchEnv.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.alertMsg.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.contextmenu.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.navTab.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.tab.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.resize.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.dialog.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.dialogDrag.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.sortDrag.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.cssTable.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.stable.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.taskBar.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.ajax.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.pagination.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.database.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.datepicker.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.effects.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.panel.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.checkbox.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.history.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.combox.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.print.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/dwz.regional.zh.js" type="text/javascript"></script>

<!-- rock add -->
<script src="<?cs var:config.dwzpath?>js/dmt.comm.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/echarts.min.js"></script>
<script src="<?cs var:config.dwzpath?>js/jquery.md5.js" type="text/javascript"></script>
<script src="<?cs var:config.dwzpath?>js/jquery.highlight-3.js?v=0.3.5"></script>
<script src="<?cs var:config.dwzpath?>js/frank_calendar.js?v=0.3.5"></script>
<script src="<?cs var:config.dwzpath?>js/jquery.json-2.3.js?v=0.3.5"></script>
<script type="text/javascript">

var g_siteInfo;
function djUserCenter()
{
	$('#dh_left_user').trigger('click');
}

function djShowConnectInfo()
{
	var op = { mask:true, maxable:false, height:400, width:420, resizable:false, drawable:true };
	$.pdialog.openLocal(
		'df_dlg_show_connect', 'df_dlg_show_connect', '联系我们', op);
}

function djOnReadyOk()
{
	// 主页相关逻辑
	dcOnMainPage();
	dcInitMainPage();
	dcRefreshStatInfo();
	setTimeout(function(){ $('#navMenuLast a').click(); }, 100);
}

/* localStorage 浏览器兼容问题 fix */
if (!window.localStorage) {
  window.localStorage = {
    getItem: function (sKey) {
      if (!sKey || !this.hasOwnProperty(sKey)) { return null; }
      return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" 
		+ escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
    },
    key: function (nKeyId) {
      return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[nKeyId]);
    },
    setItem: function (sKey, sValue) {
      if(!sKey) { return; }
      document.cookie = escape(sKey) + "=" + escape(sValue) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/";
      this.length = document.cookie.match(/\=/g).length;
    },
    length: 0,
    removeItem: function (sKey) {
      if (!sKey || !this.hasOwnProperty(sKey)) { return; }
      document.cookie = escape(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
      this.length--;
    },
    hasOwnProperty: function (sKey) {
      return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
    }
  };
  window.localStorage.length = (document.cookie.match(/\=/g) || window.localStorage).length;
}

$(document).ready(function(){
	DWZ.init("<?cs var:config.dwzpath?>dwz.frag.xml", {
		loginUrl:"login_dialog.html", loginTitle:"登录",	// 弹出登录对话框
		statusCode:{ok:200, error:300, timeout:301}, //【可选】
		pageInfo:{pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderDirection"}, //【可选】
		debug:false,	// 调试模式 【true|false】
		callback:function(){
			initEnv();
			// 检查下浏览器是否支持
			if(!dmtIsExplorerSupport())
			{
				alertMsg.warn(
					"尊敬的用户您好，控制台目前只支持 Chrome 和 Firefox 浏览器，请更换浏览器后重新登陆。"
				);
				return;
			}

			// global info for javascript use
			g_siteInfo = $.parseJSON('<?cs var:config.site_info ?>');

			$("#themeList").theme({themeBase:g_siteInfo.doc_path+"themes"}); 

			$("#a_logout").click(function(){
				var d = new Date();
				var url = g_siteInfo.cgi_path+"slog_flogin?action=logout&v="+d.getTime();
				location.replace(url);
				return false;
			});

			$("#a_relogin").click(function(){
				var url = g_siteInfo.cgi_path+"slog_flogin?action=relogin&redirect_url=";
				url += encodeURIComponent(window.location);
				url += "&user_id=<?cs var:comm.user_id ?>";
				location.replace(url);
				return false;
			});

			if(<?cs var:config.check_lv2_vcode ?>+0 == 1) {
				djLv2CheckPopDlg();
				return ;
			}

			djOnReadyOk();
		}
	});
});

</script>

